<HTML> 
<HEAD> 
	<TITLE>3rd Party ROBOTC Drivers</TITLE> 
<link href="tabs.css" rel="stylesheet" type="text/css"/> 
<link href="doxygen.css" rel="stylesheet" type="text/css"/> 
</HEAD> 
 
<BODY bgcolor="#ffffff" link="#000000" vlink="#000000"> 
<table width="100%" bgcolor="navy" cellspacing=0 cellpadding=1 border=0> 
<tr><td><table width="100%" bgcolor="#EEEEDD" cellspacing=0 cellpadding=3 border=0> 
<tr> 
    <td width="33%" align="left"> <img src="images/LOGO_NXT.gif" width=266 height=44 border="0" alt="Mindstorms"></td> 
    <td><b><font size="+3" color="navy">3rd Party ROBOTC Drivers</font></b></td> 
    <td align="right"> <img src="images/logo.png" width=44 height=44 border="0" alt="RobotC"></td>     
</tr> 
  <tr bgcolor="#cccc99" align="right"> 
          <td colspan=3> <font face="arial" size="-1"> [<a href=main.html>Home</a>] [<a target=_top href="https://sourceforge.net/projects/rdpartyrobotcdr/">Download</a>] [<a target=_top href="http://apps.sourceforge.net/mantisbt/rdpartyrobotcdr/my_view_page.php">Submit a bug/suggestion</a>]  [<a target=_top href="http://www.robotc.net/forums/">ROBOTC Forums</a>] [<a target=_top href="http://botbench.com">Blog</a>] [<a target=_top href="http://sourceforge.net/donate/index.php?group_id=257238">Support this project</a>]</font> </td> 
</tr> 
</table></td></tr> 
</table> 
<!-- Generated by Doxygen 1.7.2 -->
<div class="header">
  <div class="summary">
<a href="#files">Files</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<h1>dFlex Sensor<br/>
<small>
[<a class="el" href="group___dexter___industries.html">Dexter Industries</a>]</small>
</h1>  </div>
</div>
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="files"></a>
Files</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dexterind-flex_8h.html">dexterind-flex.h</a></td></tr>

<p><tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><p>ROBOTC Dexter Industries dFlex Sensor driver. </p>
<br/></td></tr>
</p>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#ga769c428f65f424546a7449c58ea68759">DFLEXDAT</a>&#160;&#160;&#160;&quot;DFLEX.dat&quot;</td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#ga6cb0d8975cddb152c9f484f7d2384a53">DFLEXvalRaw</a> (tSensors link)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#ga50b86a054fdc97b337658fae58f1bd8e">DFLEXvalNorm</a> (tSensors link)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#gafec1f1b1b5145a264a6e5282b547631e">DFLEXcalLow</a> (tSensors link)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#gaf675719dd00fa8dff782600b9c20d9be">DFLEXcalLow</a> (int lowval)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#ga42974ea404ff3b6540996a40c4c70741">DFLEXcalHigh</a> (tSensors link)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#ga75e70b6614d4596a1c6ce0ad423002d2">DFLEXcalHigh</a> (int highval)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#gaee2c67089fc624cace4bb8f4a40029d8">_DFLEXcheckSensor</a> (tSensors link)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#ga9db0a5c5a81c69d52c05a05b97282f05">_DFLEXwriteCalVals</a> (int lowval, int highval)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#gaa2c532164ef9b67a36dd66b814d6459d">_DFLEXreadCalVals</a> (int &amp;lowval, int &amp;highval)</td></tr>
<tr><td colspan="2"><h2><a name="var-members"></a>
Variables</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#ga7d8e810df952320157207399755663aa">dflexlow</a> = 0</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#gafcb9b240cb7b01f32bd00af317948a7c">dflexhigh</a> = 1023</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__d_flex.html#ga3fa5367fb5af70a40a3482f1b7076165">DFLEX_calibrated</a> = false</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Dexter Industries dFlex Sensor driver </p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="ga769c428f65f424546a7449c58ea68759"></a><!-- doxytag: member="dexterind&#45;flex.h::DFLEXDAT" ref="ga769c428f65f424546a7449c58ea68759" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define DFLEXDAT&#160;&#160;&#160;&quot;DFLEX.dat&quot;</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Datafile for dFlex Sensor calibration info </p>

<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00042">42</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaee2c67089fc624cace4bb8f4a40029d8"></a><!-- doxytag: member="dexterind&#45;flex.h::_DFLEXcheckSensor" ref="gaee2c67089fc624cace4bb8f4a40029d8" args="(tSensors link)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void _DFLEXcheckSensor </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Check if the sensor is set to raw and that it's been configured as a sensorAnalogInactive. If not, reconfigure the port.</p>
<p>Note: this is an internal function and should not be called directly </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the dFlex Sensor port number </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00153">153</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaa2c532164ef9b67a36dd66b814d6459d"></a><!-- doxytag: member="dexterind&#45;flex.h::_DFLEXreadCalVals" ref="gaa2c532164ef9b67a36dd66b814d6459d" args="(int &amp;lowval, int &amp;highval)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void _DFLEXreadCalVals </td>
          <td>(</td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"> <em>lowval</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&#160;</td>
          <td class="paramname"> <em>highval</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read the low and high calibration values from a data file.</p>
<p>Note: this is an internal function and should not be called directly </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">lowval</td><td>the low calibration value </td></tr>
    <tr><td class="paramname">highval</td><td>the high calibration value </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00228">228</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga9db0a5c5a81c69d52c05a05b97282f05"></a><!-- doxytag: member="dexterind&#45;flex.h::_DFLEXwriteCalVals" ref="ga9db0a5c5a81c69d52c05a05b97282f05" args="(int lowval, int highval)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void _DFLEXwriteCalVals </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>lowval</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>highval</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Write the low and high calibration values to a data file.</p>
<p>Note: this is an internal function and should not be called directly </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">lowval</td><td>the low calibration value </td></tr>
    <tr><td class="paramname">highval</td><td>the high calibration value </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00168">168</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga75e70b6614d4596a1c6ce0ad423002d2"></a><!-- doxytag: member="dexterind&#45;flex.h::DFLEXcalHigh" ref="ga75e70b6614d4596a1c6ce0ad423002d2" args="(int highval)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void DFLEXcalHigh </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>highval</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Calibrate the dFlex Sensor's high calibration value with the supplied value. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">highval</td><td>the sensor's high calibration value </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00140">140</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga42974ea404ff3b6540996a40c4c70741"></a><!-- doxytag: member="dexterind&#45;flex.h::DFLEXcalHigh" ref="ga42974ea404ff3b6540996a40c4c70741" args="(tSensors link)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void DFLEXcalHigh </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Calibrate the dFlex Sensor's high calibration value with the current raw sensor reading. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the dFlex Sensor port number </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="dexterind-flex-test2_8c-example.html#a1">dexterind-flex-test2.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00128">128</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
<a class="anchor" id="gaf675719dd00fa8dff782600b9c20d9be"></a><!-- doxytag: member="dexterind&#45;flex.h::DFLEXcalLow" ref="gaf675719dd00fa8dff782600b9c20d9be" args="(int lowval)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void DFLEXcalLow </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"> <em>lowval</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Calibrate the dFlex Sensor's low calibration value with the supplied value. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">lowval</td><td>the sensor's low calibration value </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00118">118</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
<a class="anchor" id="gafec1f1b1b5145a264a6e5282b547631e"></a><!-- doxytag: member="dexterind&#45;flex.h::DFLEXcalLow" ref="gafec1f1b1b5145a264a6e5282b547631e" args="(tSensors link)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void DFLEXcalLow </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Calibrate the dFlex Sensor's low calibration value with the current raw sensor reading. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the dFlex Sensor port number </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="dexterind-flex-test2_8c-example.html#a0">dexterind-flex-test2.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00106">106</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga50b86a054fdc97b337658fae58f1bd8e"></a><!-- doxytag: member="dexterind&#45;flex.h::DFLEXvalNorm" ref="ga50b86a054fdc97b337658fae58f1bd8e" args="(tSensors link)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int DFLEXvalNorm </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read the normalised value of the dFlex Sensor, based on the low and high values.</p>
<p>Note: this is not a linear value </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the dFlex Sensor port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the normalised value (0-100) </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="dexterind-flex-test1_8c-example.html#a1">dexterind-flex-test1.c</a>, and <a class="el" href="dexterind-flex-test2_8c-example.html#a3">dexterind-flex-test2.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00082">82</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga6cb0d8975cddb152c9f484f7d2384a53"></a><!-- doxytag: member="dexterind&#45;flex.h::DFLEXvalRaw" ref="ga6cb0d8975cddb152c9f484f7d2384a53" args="(tSensors link)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int DFLEXvalRaw </td>
          <td>(</td>
          <td class="paramtype">tSensors&#160;</td>
          <td class="paramname"> <em>link</em>&#160;)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Read the raw value of the dFlex Sensor. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">link</td><td>the dFlex Sensor port number </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the raw value of the dFlex Sensor </dd></dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="dexterind-flex-test1_8c-example.html#a0">dexterind-flex-test1.c</a>, and <a class="el" href="dexterind-flex-test2_8c-example.html#a2">dexterind-flex-test2.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00068">68</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
<hr/><h2>Variable Documentation</h2>
<a class="anchor" id="ga3fa5367fb5af70a40a3482f1b7076165"></a><!-- doxytag: member="dexterind&#45;flex.h::DFLEX_calibrated" ref="ga3fa5367fb5af70a40a3482f1b7076165" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="group__d_flex.html#ga3fa5367fb5af70a40a3482f1b7076165">DFLEX_calibrated</a> = false</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Has the sensor been calibrated yet </p>

<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00047">47</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
<a class="anchor" id="gafcb9b240cb7b01f32bd00af317948a7c"></a><!-- doxytag: member="dexterind&#45;flex.h::dflexhigh" ref="gafcb9b240cb7b01f32bd00af317948a7c" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__d_flex.html#gafcb9b240cb7b01f32bd00af317948a7c">dflexhigh</a> = 1023</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>High calibration value </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="dexterind-flex-test2_8c-example.html#a5">dexterind-flex-test2.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00046">46</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
<a class="anchor" id="ga7d8e810df952320157207399755663aa"></a><!-- doxytag: member="dexterind&#45;flex.h::dflexlow" ref="ga7d8e810df952320157207399755663aa" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group__d_flex.html#ga7d8e810df952320157207399755663aa">dflexlow</a> = 0</td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Low calibration value </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="dexterind-flex-test2_8c-example.html#a4">dexterind-flex-test2.c</a>.</dd>
</dl>
<p>Definition at line <a class="el" href="dexterind-flex_8h_source.html#l00045">45</a> of file <a class="el" href="dexterind-flex_8h_source.html">dexterind-flex.h</a>.</p>

</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Mar 13 2013 19:56:44 for ROBOTC Drivers by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
</body>
</html>
